package com.heima.leadnews.article.controller.feign;

import com.heima.leadnews.article.service.ApArticleService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private ApArticleService apArticleService;

    /**
     * 保存article表
     * @param wmNewsDto
     */
    @PostMapping("/saveArticle")
    public ResponseResult saveArticle(@RequestBody WmNewsDto wmNewsDto){
        return apArticleService.saveArticle(wmNewsDto);
    }

    /**
     * 添加静态化页面url
     * @param id
     * @param url
     * @return
     */
    @PutMapping("/updateStaticUrl")
    public ResponseResult updateStaticUrl(@RequestParam("articleId") Long id,@RequestParam("url")String url){
        return apArticleService.updateStaticUrl(id,url);
    }
}
